package net.discard.model.jy.enums;

import xyz.erupt.annotation.fun.ChoiceFetchHandler;
import xyz.erupt.annotation.fun.VLModel;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @Author: Discard
 * @Date: 2021/1/29 3:30 下午
 */
public class PowerEnum implements ChoiceFetchHandler {

    public static Map<Integer, String> enumMap = null;

    static {
        enumMap = new HashMap<Integer, String>();
        enumMap.put(0, "0.5");
        enumMap.put(1, "0.7");
        enumMap.put(2, "1.0");
    }

    @Override
    public List<VLModel> fetch(String[] params) {
        List<VLModel> list = new ArrayList<>();
        for (String param : params) {
            list.add(new VLModel(param, param));
        }
        for (Integer key : enumMap.keySet()) {
            list.add(new VLModel(key + "", enumMap.get(key)));
        }
        return list;
    }

    public static String getValue(Integer key) {
        return enumMap.get(key);
    }
}
